package cn.bearspark.comment.provider.dao.buffer;

import cn.bearspark.comment.provider.dao.co.LayerCommentCO;
import cn.bearspark.comment.provider.dao.key.LayerCommentBufferKeyBuilder;
import cn.bearspark.comment.provider.dao.mapper.LayerCommentMapper;
import cn.bearspark.framework.redis.starter.buffer.hash.un.RedisHashBuffer;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * 层评论数据的缓存器
 *
 * @author f
 */
@Component
public class LayerCommentBuffer extends RedisHashBuffer<LayerCommentCO> {

    /**
     * 设置层评论数据的缓存的有效期（单位：s），默认是 1min
     */
    private static final int LAYER_COMMENT_INFO_CACHE_EXPIRE = 60;

    public LayerCommentBuffer(RedisTemplate<String, Object> redisTemplate,
                              LayerCommentBufferKeyBuilder layerCommentBufferKeyBuilder,
                              LayerCommentMapper layerCommentMapper) {
        super(
                redisTemplate,
                layerCommentBufferKeyBuilder,
                LAYER_COMMENT_INFO_CACHE_EXPIRE,
                LayerCommentCO.class,
                layerCommentMapper
        );
    }

}
